package com.hh.test.io;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;

public class TraditionIO {

	public static void main(String[] args) {
		long st = System.currentTimeMillis();
		String fileOut = "C:\\workspace\\w0\\test\\src\\test\\java\\com\\hh\\test\\io\\fileOut.txt";

		try {
			FileReader file;
			FileOutputStream out = new FileOutputStream(fileOut);
			file = new FileReader("C:\\workspace\\w0\\test\\src\\test\\java\\com\\hh\\test\\io\\txt.txt");
			BufferedReader read = new BufferedReader(file);
			String line = null;
			while ((line = read.readLine()) != null) {
				line += "\r\n";
				out.write(line.getBytes());
			}

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		System.out.println(System.currentTimeMillis() - st);
		//3309
		try {
			Thread.sleep(1000 * 200);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	private void trycatch() {
		try (FileInputStream f=new FileInputStream("")){
			f.close();
		} catch (Exception e) {
			// TODO: handle exception
		}

	}
}
